package com.jy.oms.framework.asyn.task.util;

import com.jy.oms.framework.asyn.task.exception.TaskConfigException;
import org.springframework.lang.Nullable;

/**
 * assert
 *
 * @author liuquan
 */
public final class AssertTask {
    private AssertTask() {
    }

    public static void notNull(@Nullable Object object, String message) {
        if (object == null) {
            throw new TaskConfigException(message);
        }
    }

    public static void isNull(@Nullable Object object, String message) {
        if (object != null) {
            throw new TaskConfigException(message);
        }
    }

    public static void isTrue(boolean expression, String message) {
        if (!expression) {
            throw new TaskConfigException(message);
        }
    }
}
